<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        ul {
            display: flex;
            list-style: none;
        }

        ul>li {
            margin-right: 30px;
            text-align: center;
        }

        img {
            /* text-align: center; */
            width: 100px;
        }

        .di {
            /* width: 300px;
            height: 400px; */
            position: fixed;
            top: 150px;
            left: 50%;
            transform: translateX(-50%);
            background-color: rgb(88, 252, 66);
            padding: 20px;
        }

        .di>p:nth-of-type(1) {
            position: absolute;
            top: 0;
            right: 10px;
            cursor: pointer;
        }
        .di>div{
            text-align: center;
        }
    </style>
</head>

<body>
    <div id="vx">
        <ul>
            <li v-for='(value,index) in arr' @click='togg(index)'>
                <img :src="value.src" alt="">
                <p>名称：{{value.name}}</p>
                <p>价格：{{value.num}}</p>
            </li>
        </ul>
        <div v-if="flag" class="di">
            <div v-for='(value,index) in newarr'>
                <img :src="value.src" alt="">
                <p>详情：{{value.xiang}}</p>
                <p>价格：{{value.num}}</p>
            </div>
            <p @click="show">X</p>
        </div>
    </div>
    <script src="./node_modules/vue/dist/vue.js"></script>
    <script src="./js/test.js"></script>
</body>

</html>